Reading queries topic

Four equal ways to read a query, with no recommended default; they mix freely in one screen. context.query (QueryContext) reads in any widget's build; QueryMixin.watchQuery reads in a State; QueryBuilder and QuerySelectBuilder rebuild exactly their subtree; QueryController is a plain ValueListenable for view models and code without widgets. Each takes a BuildWhen to narrow when it rebuilds.

Classes

QueryBuilder<TData> Reading queries
Builds its subtree from a query's result — the StreamBuilder shape.
QueryController<TQueryData, TData> Reading queries
One query, as a ValueListenable of its QueryResult.
QuerySelectBuilder<TQueryData, TData> Reading queries
QueryBuilder for a query with a select: the cache holds TQueryData, the builder sees TData.

Extensions

QueryContext on BuildContext Reading queries Mutations Infinite queries
Reads queries and mutations straight from a BuildContext, in build.

Typedefs

BuildWhen<T> = bool Function(T previous, T current) Reading queries
Whether a reader should rebuild for a change from previous to current — the buildWhen every call style takes.